<?php if($type!=="excel") { ?>
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Rekap Prestasi</title>
		<style type="text/css">
			@media screen{
				body {
					font: normal 11px auto "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
					color: #4f6b72;
					background: #E6EAE9;
				}
			}
			@media print{
				body {
					font: normal 11px auto "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
				}
			}
			body{
				margin : 5px;
			}
			a {
				color: #c75f3e;
			}
			
			#mytable {
				width: 100%;
				padding: 0;
				margin: 0;
			}
			
			caption {
				padding: 0 0 5px 0;
				width: 100%;	 
				font: italic 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
				text-align: center;
			}
			
			th {
				font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
				color: #4f6b72;
				border-right: 1px solid #C1DAD7;
				border-bottom: 1px solid #C1DAD7;
				border-top: 1px solid #C1DAD7;
				letter-spacing: 2px;
				text-transform: uppercase;
				text-align: left;
				padding: 6px 6px 6px 12px;
				background: #CAE8EA url(./assets/images/bg_header.jpg) no-repeat;
			}
			
			th.nobg {
				border-top: 0;
				border-left: 0;
				border-right: 1px solid #C1DAD7;
				background: none;
			}
			
			td {
				border-right: 1px solid #C1DAD7;
				border-bottom: 1px solid #C1DAD7;
				background: #fff;
				padding: 6px 6px 6px 12px;
				color: #4f6b72;
				font: normal 12px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
			}
			
			td.alt {
				background: #F5FAFA;
				color: #797268;
			}
			
			th.spec {
				border-left: 1px solid #C1DAD7;
				border-top: 0;
				background: #fff url(./assets/images/bullet1.gif) no-repeat;
				font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
			}
			
			th.specalt {
				border-left: 1px solid #C1DAD7;
				border-top: 0;
				background: #f5fafa url(./assets/images/bullet2.gif) no-repeat;
				font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
				color: #797268;
			}
			table, tr, td, th{
				border : 1px solid black;
				border-collapse:collapse;
			}
			</style>
	</head>
	<body onload="window.print();">
<?php } else { ?>
	<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Rekap Prestasi</title>
	<style>
		.table{
			border-collapse:collapse;      
		}
	</style>
		<xml>
		 <x:ExcelWorkbook>
		  <x:ExcelWorksheets>
		   <x:ExcelWorksheet>
			<x:Name>Sheet</x:Name>
			<x:WorksheetOptions>
			 <x:Print>
				<x:Gridlines />
			 </x:Print>
			</x:WorksheetOptions>
		   </x:ExcelWorksheet>
		  </x:ExcelWorksheets>
		 </x:ExcelWorkbook>
		</xml>
	</head>
	<body>
<?php } ?>
<table summary='Rekap Prestasi' id="mytable">
	<caption><?php echo $title ?></caption>
	<thead>
		<tr>
			<th scope='col'>No</th>
			<th scope='col'>NISN</th>
			<th scope='col'>Kelas</th>
			<th scope='col'>Nama Siswa</th>
			<th scope='col'>Level</th>
			<th scope='col'>Peringkat</th>
			<th scope='col'>Kompetisi</th>
			<th scope='col'>Skor</th>
		</tr>
	</thead>
	<tbody>
		<?php $i=0; foreach($records as $sub) { $i++; ?>
		<tr>
			<td><?php echo $i; ?></td>
			<td><?php echo $sub->siswa_nis; ?></td>
			<td><?php echo $sub->siswa_kelas; ?></td>
			<td><?php echo $sub->siswa_nama; ?></td>
			<td><?php echo $sub->level_nama; ?></td>
			<td><?php echo $sub->juara_nama; ?></td>
			<td><?php echo $sub->lomba_judul; ?></td>
			<td><?php echo $sub->prestasi_skor; ?></td>
			</tr>
		<?php } ?>
	</tbody>
</body>
</html>